# encoding: utf-8
__author__ = 'wwj'
import pymongo
from dmmres import down
client = pymongo.MongoClient("47.74.21.140",socketKeepAlive=True,maxPoolSize=400)
client.admin.authenticate("admin321", "dsf::6666,,<<", mechanism='SCRAM-SHA-1')
for x in client.xvideo.video.find({"status":{"$exists":False}},{},no_cursor_timeout=True).batch_size(13):
    print (x["url"])
    if x.get("thumb"):
        down.delay(x.get("thumb"))
    if x.get("bigImg"):
        down.delay(x.get("bigImg"))
    if x.get("video"):
        down.delay(x.get("video"))
    if x.get("imgList"):
        for y in x["imgList"]:
            down.delay(y)
            y = y.replace("-","jp-")
            down.delay(y)